Skip to content

feat(interop): allow specifying port to bind to#220

Closed
achingbrain wants to merge 1 commit intomasterfrom
feat/allow-specifying-port
Closed

feat(interop): allow specifying port to bind to#220
achingbrain wants to merge 1 commit intomasterfrom
feat/allow-specifying-port

Conversation

@achingbrain
Copy link
Copy Markdown
Member

@achingbrain achingbrain commented Jul 5, 2023

Ping listeners implementations seem to all bind to random ports during test runs, then report their multiaddr to redis. Dialers receive the multiaddr from redis and dial it.

This is great when everything is under Docker.

If you are trying to run one half of the test from locally running code and the other from a docker container in order to debug things you need to know the port the docker half will be listening on when you build the container in order to EXPOSE the port and make it available to the host machine, so the docker half can't use random ports.

Running the non-local half of the test as a Docker image is preferable to building from source since it reduces the amount of assumed knowledge the developer has about how to build a rust/nim/zig/go/js/java project and doesn't require them to set up esoteric toolchains for what is hopefully an infrequent task.

The change here is to specify a port env var that can be used to control this, defaulting to '0', the value that seems to be used everywhere currently.

Ping listeners implementations seem to all bind to random ports during test runs, then report their multiaddr to redis.  Dialers receive the multiaddr from redis and dial it.

This is great when everything is under Docker.

If you are trying to run one half of the test from locally running code and the other from a docker container in order to debug things you need to know the port the docker half will be listening on when you build the container in order to `EXPOSE` the port and make it available to the host machine, so the docker half can't use random ports.

The change here is to specify a `port` env var that can be used to control this, defaulting to `'0'`, the value that seems to be used everywhere currently.
@MarcoPolo
Copy link
Copy Markdown
Contributor

This is fine by me. Although I wouldn't expect this change to be backported to all released versions. It would be easy to have newer versions support this though.

As a workaround, you could use net=host on Docker. This might not work on a macOS docker setup.

@dhuseby
Copy link
Copy Markdown
Contributor

dhuseby commented May 1, 2025

@achingbrain this has been laying around here for more than a year. can we close this?

@dhuseby
Copy link
Copy Markdown
Contributor

dhuseby commented May 27, 2025

This is likely stale and no longer needed. If we do end up needing this, feel free to re-open.

@dhuseby dhuseby closed this May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants